package com.zahb.qadx.ui.activity.videopage;

import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.LinearLayoutManager;

import com.bokecc.sdk.mobile.play.DWMediaPlayer;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.listener.OnItemClickListener;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.zahb.qadx.R;
import com.zahb.qadx.base.BaseActivityV2;

import com.zahb.qadx.databinding.ActivityVideoRecyclerViewBinding;
import com.zahb.qadx.model.CommonData;
import com.zahb.qadx.model.MicroVideoData;
import org.jetbrains.annotations.NotNull;

/**
 * RecyclerView 实现滑动
 */
public class VideoRecyclerViewActivity extends BaseActivityV2 implements OnItemClickListener {
    private ActivityVideoRecyclerViewBinding mBinding;
    private BaseQuickAdapter<MicroVideoData.MicroVideoBean, BaseViewHolder> mAdapter;
    private static CommonData<MicroVideoData.MicroVideoBean> microVideoBeans;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

    }

    @Override
    protected void initViews() {


    }

    @Override
    protected int getTitleStringRes() {
        return R.string.micro_video_list;
    }

    @Override
    public void initViewBinding() {
        mBinding = ActivityVideoRecyclerViewBinding
                .inflate(getLayoutInflater(), mContainer, true);

        microVideoBeans = (CommonData<MicroVideoData.MicroVideoBean>) getIntent().getSerializableExtra("bean");//上个页面给的集合
        LinearLayoutManager mLayoutManager = new LinearLayoutManager(this);
        mLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
        mBinding.recyclerView.setLayoutManager(mLayoutManager);




        mAdapter.addData(microVideoBeans.getList());
        mAdapter.setOnItemClickListener(this);
        mBinding.recyclerView.setAdapter(mAdapter);

    }


    @Override
    public void onItemClick(@NonNull @NotNull BaseQuickAdapter<?, ?> adapter, @NonNull @NotNull View view, int position) {

    }
}